/**
 * 公共抽屉组件
 */
import { Drawer } from 'antd'
import React from 'react'
import './index.less'
interface MallDrawerProps {
  open: boolean //显示/隐藏
  title: string //抽屉名
  onClose: () => void //关闭抽屉
  footer?: React.ReactNode //页脚显示
  children: React.ReactNode
  className?: string //类
}

const MallDrawer = (props: MallDrawerProps) => {
  const { open, title, onClose, footer, children } = props
  const size = 'large'
  const onCloseDrawer = () => {
    onClose()
  }
  return (
    <Drawer
      title={title}
      placement="right"
      onClose={onCloseDrawer}
      open={open}
      width={600}
      maskClosable={false}
      className="mallDrawer"
      footer={footer}
    >
      {children}
    </Drawer>
  )
}

export default MallDrawer
